package com.huangpeng.designmodel.beanLifeCycle;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author hp
 * @Title 测试类
 * @Package
 * @Date 2022/1/7 17:41
 * @Description
 * @Version 1.0
 */
public class AcPersonServiceTest {
    public static void main(String[] args) {
        System.out.println("开始初始化容器");
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        System.out.println("xml加载完毕");
        Person p = (Person) applicationContext.getBean("p");
        System.out.println(p);
        System.out.println("关闭容器");
        ((ClassPathXmlApplicationContext)applicationContext).close();
    }
}
